home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / net / Proxy.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  1.3 KB  |  57 lines

  1. package java.net;
  2.  
  3. public class Proxy {
  4.    private Type type;
  5.    // $FF: renamed from: sa java.net.SocketAddress
  6.    private SocketAddress field_0;
  7.    public static final Proxy NO_PROXY = new Proxy();
  8.  
  9.    private Proxy() {
  10.       Type var10001 = this.type;
  11.       this.type = java.net.Proxy.Type.DIRECT;
  12.       this.field_0 = null;
  13.    }
  14.  
  15.    public Proxy(Type var1, SocketAddress var2) {
  16.       if (var1 != java.net.Proxy.Type.DIRECT && var2 instanceof InetSocketAddress) {
  17.          this.type = var1;
  18.          this.field_0 = var2;
  19.       } else {
  20.          throw new IllegalArgumentException("type " + var1 + " is not compatible with address " + var2);
  21.       }
  22.    }
  23.  
  24.    public Type type() {
  25.       return this.type;
  26.    }
  27.  
  28.    public SocketAddress address() {
  29.       return this.field_0;
  30.    }
  31.  
  32.    public String toString() {
  33.       return this.type() == java.net.Proxy.Type.DIRECT ? "DIRECT" : this.type() + " @ " + this.address();
  34.    }
  35.  
  36.    public final boolean equals(Object var1) {
  37.       if (var1 != null && var1 instanceof Proxy) {
  38.          Proxy var2 = (Proxy)var1;
  39.          if (var2.type() == this.type()) {
  40.             if (this.address() == null) {
  41.                return var2.address() == null;
  42.             } else {
  43.                return this.address().equals(var2.address());
  44.             }
  45.          } else {
  46.             return false;
  47.          }
  48.       } else {
  49.          return false;
  50.       }
  51.    }
  52.  
  53.    public final int hashCode() {
  54.       return this.address() == null ? this.type().hashCode() : this.type().hashCode() + this.address().hashCode();
  55.    }
  56. }
  57.